package com.lanqiaofinal11;

import java.io.*;
import java.util.Arrays;

/**
 * @author `RKC`
 * @date 2022/6/17 13:49
 */
public class H画廊_prim {

    private static final int N = 1010, INF = 0x3f3f3f3f;
    private static double[][] p = new double[N][2], g = new double[N][N];
    private static boolean[] st = new boolean[N];
    private static double[] dist = new double[N];
    private static int l, r, d, w, n;

    private static StreamTokenizer tokenizer = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
    private static PrintWriter writer = new PrintWriter(new OutputStreamWriter(System.out));

    public static void main(String[] args) throws IOException {
        l = nextInt(); r = nextInt(); d = nextInt(); w = nextInt();
        n = l + r + 2;
        p[0][0] = w / 2.0;
        for (int i = 1; i <= l; i++) p[i][1] = nextInt();
        for (int i = l + 1; i <= l + r; i++) {
            p[i][0] = w;
            p[i][1] = nextInt();
        }
        p[n - 1][0] = w / 2.0;
        p[n - 1][1] = d;
        build();
        writer.format("%.2f\n", prim());
        writer.flush();
    }

    private static double prim() {
        double res = 0;
        Arrays.fill(dist, INF);
        dist[0] = 0;
        for (int k = 1; k <= n; k++) {
            int u = -1;
            for (int i = 0; i < n; i++) {
                if (!st[i] && (u == -1 || dist[i] < dist[u])) {
                    u = i;
                }
            }
            res += dist[u];
            st[u] = true;
            for (int v = 0; v < n; v++) dist[v] = Math.min(dist[v], g[u][v]);
        }
        return res;
    }

    private static void build() {
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                if (i == j) continue;
                g[i][j] = get(i, j);
            }
        }
    }

    private static double get(int i, int j) {
        double x1 = p[i][0], y1 = p[i][1], x2 = p[j][0], y2 = p[j][1];
        return Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
    }

    private static int nextInt() throws IOException {
        tokenizer.nextToken();
        return (int) tokenizer.nval;
    }
}
